package test;

public class ZFBPay implements Pay {
    private double m = 300.0;  // 初始余额

    public void pay(double money) {
        if (m >= money) {
            System.out.println("支付宝支付" + money + "元");
            m -= money;
            System.out.println("支付成功！当前余额为：" + m);
        } else {
            System.out.println("支付宝余额不足，支付失败！");
        }
    }

    public double getBalance() {
        return m;
    }
}
